package lsp_violation

type actions interface {
    drive()
    startEngine()
}

type Vehicle struct {
    // 车辆
}

func (v Vehicle) drive() {
    // todo
}

func (v Vehicle) startEngine() {
    // todo
}

func (v Vehicle) stopEngine() {
    // todo
}

type Car struct {
    Vehicle
}

type Sled struct {
    // 雪橇
    Vehicle
}

func (s Sled) startEngine() {
    // override so that is does nothing

}
func (s Sled) stopEngine() {

    // override so that is does nothing
}
func (s Sled) pushStart() {
    // TODO: implement
}

func Go(vehicle actions) {
    if sled, ok := vehicle.(*Sled); ok {
        sled.pushStart()
    } else {
        vehicle.startEngine()
    }
    vehicle.drive()
}
